package com.xushu.service;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class MainRun {

	public static void main(String[] args) throws Exception {

		// 加载spring上下文 创建所有的单例Bean
		AnnotationConfigApplicationContext ioc =
				new AnnotationConfigApplicationContext(ConfigClass.class);


		// 获取Bean
		UserService userService = (UserService)ioc.getBean("userService");

		userService.add();

	}
}
